package com.cy.com.cy.pj.goods.dao.imp;

import com.cy.goods.dao.GoodsDao;
import com.cy.pojo.Dao;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 数据逻辑层
 */
@Repository

public class GoodsDaoImp implements GoodsDao {
    @Autowired
    SqlSession sqlSession;
    @Override
    public List<Dao> findAll() {
        this.getClass().getInterfaces()[0].getName();
        Thread.currentThread().getStackTrace()[1].getMethodName();
        String sql="com.cy.goods.dao.Goods.Dao.findAll"; //映射文件和方法名
        List<Dao> list = sqlSession.selectList(sql);
        return list;
    }
}
